package com.heukyosuk.file;

import java.util.ArrayList;

import com.heukyosuk.main.R;
import com.heukyosuk.main.R.id;
import com.heukyosuk.main.R.layout;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class FileAdapter extends ArrayAdapter<FileClass> {

	public FileAdapter(Context context, ArrayList<FileClass> name) {
		super(context, R.layout.list_item, name);
	} 

	@Override 
	public View getView(int position, View convertView, ViewGroup parent) {
		FileClass file = getItem(position);    
		if (convertView == null) {
			convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_item, parent, false);
		} 
		
		TextView tvName = (TextView) convertView.findViewById(R.id.title);
		TextView tvDate = (TextView) convertView.findViewById(R.id.desc);
		tvName.setText(file.fileName);
		tvDate.setText(file.editDate);

		return convertView;
	}
}